#pk s Contributor: Leonardo Arena <rnalrd@alpinelinux.org>
# Contributor: Justin Berthault <justin.berthault@zaclys.net>
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=py3-django-crispy-forms
pkgver=2.3
pkgrel=0
pkgdesc="Dry Django forms"
url="https://github.com/django-crispy-forms/django-crispy-forms"
arch="noarch"
license="MIT"
depends="py3-django"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-wheel
	"
checkdepends="py3-pytest py3-crispy-bootstrap3 py3-crispy-bootstrap4"
options="!check" # circular dependencies with py3-crispy-bootstrap{3,4}
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/django-crispy-forms/django-crispy-forms/archive/refs/tags/$pkgver.tar.gz"
builddir="$srcdir"/django-crispy-forms-$pkgver

replaces="py-django-crispy-forms" # Backwards compatibility
provides="py-django-crispy-forms=$pkgver-r$pkgrel" # Backwards compatibility

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest -v
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
1c5ad8a64a6f8175a6d5eb56b244d856c8aab1ebcc8c4b549aebfa4711128d1401ad0f625ca68c10fb1b0be9656c662e865e783994f323f87e5b08da4bd0585a  py3-django-crispy-forms-2.3.tar.gz
"
